#!/usr/bin/env python
PACKAGE = "urban_road_filter"

from dynamic_reconfigure.parameter_generator_catkin import *

gen = ParameterGenerator()

#Parameter list.
#Fixed frame.
gen.add("fixed_frame", str_t, 0, "Fixed frame. (Restart needed if it changes.)", "left_os1/os1_lidar")

#The desired topic to subscibe to.
gen.add("topic_name", str_t, 0, "(Restart needed if it changes.)", "/left_os1/os1_cloud_node/points")

#Enabling individual detection methods.
gen.add("x_zero_method", bool_t, 0, "x zero method.", True)
gen.add("z_zero_method", bool_t, 0, "z zero method.", True)
gen.add("star_shaped_method", bool_t, 0, "star shaped method", True)
gen.add("blind_spots", bool_t, 0, "Filtering blind spots.", True)

#Vakfolt (+-,+,-) X iranyu vizsgalata.
#Blindspot detection (x-direction)
size_enum = gen.enum([gen.const("bothX", int_t, 0, "Filtering in both negative and positive direction along the Lidars X axis"),
                    gen.const("positiveX", int_t, 1, "Filtering only in +X ."),
                    gen.const("negativeX", int_t, 2, "Filtering only in -X.")],
                    "Filtering blind spots in  (+-,+,-) X direction.")
gen.add("xDirection", int_t, 0, "Filtering blind spots in  (+-,+,-) X direction.", 0, 0, 2, edit_method=size_enum)

#A LIDAR vertikalis szogfelbontassanak, elfogadott intervalluma.
gen.add("interval", double_t, 0, "LIDAR's vertical resolution", 0.1800, 0.0100, 10)

#Becsult, minimalis szegely magassag.
gen.add("curb_height", double_t, 0, "Estimated minimum height of the curb.[m]", 0.0500, 0.0100, 0.5000)

#A pontok becsult szama, a szegelyen.
gen.add("curb_points", int_t, 0, "Estimated number of points on the curb.[pcs]", 5, 1, 30)

#A vizsgalt sugarzona.
gen.add("beamZone", double_t, 0, "Width of the beam zone.[deg]", 30, 10, 100)

#Minimum X - Maximum X
gen.add("min_x", double_t, 0, "Size of the examined area: Min X [m].", 0, -200, 200)
gen.add("max_x", double_t, 0, "Size of the examined area:: Max X [m].", 30, -200, 200)

#Minimum Y - Maximum Y
gen.add("min_y", double_t, 0, "Size of the examined area: Min Y [m].", -10, -200, 200)
gen.add("max_y", double_t, 0, "Size of the examined area: Max Y [m].", 10, -200, 200)

#Minimum Z - Maximum Z
gen.add("min_z", double_t, 0, "Size of the examined area: Min Z [m]. ", -3, -200, 200)
gen.add("max_z", double_t, 0, "Size of the examined area: Max Z [m].", -1, -200, 200)

#X = 0 ertek mellett, harom pont altal bezart szog.
gen.add("cylinder_deg_x", double_t, 0, "The included angle of the examined triangle(three point)[deg]. - x_zero_method", 150, 0, 180)

#Z = 0 ertek mellett, ket vektor altal bezart szog.
gen.add("cylinder_deg_z", double_t, 0, "The included angle of the examined triangle(two vectors)[deg]. - z_zero_method", 140, 0, 180)

#Csaplar Laszlo kodjahoz szukseges. Sugar iranyu szog hatarertek (fokban).
gen.add("curb_slope_deg", double_t, 0, "Radial threshold [deg]. - star_shaped_method", 50, 0, 180)

#Szoras - Egyutthato. - CSP
gen.add("kdev_param", double_t, 0, "Disperion coefficient", 1.225, 0.5, 5)

#Tavolsag - Egyutthato. - CSP
gen.add("kdist_param", double_t, 0, "Distance coefficient", 2, 0.4, 10)

#Star-beam Filter
gen.add("starbeam_filter", bool_t, 0, "Use rectangular beams for detection instead of the whole sectors (StarShaped)", False)

#Min. pontok szorasahoz. - CSP
gen.add("dmin_param", int_t, 0, "Min number of points for dispersion", 10, 3, 30)

#Size of cells in the grid post-processor.
gen.add("grid_cell_size", double_t, 0, "Set the size of cells in the grid - WARNING! UNSTABLE FEATURE! (+requires node restart) [default = 1.0]", 1, 0.1, 3)

#Polygon egyszerusites engedelyezese (CSP)
gen.add("simple_poly_allow", bool_t, 0, "Use simplified polygon (height data will be omitted!)", True)

#Polygon-egyszerusites egyutthatoja (CSP)
gen.add("poly_s_param", double_t, 0, "Coefficient of polygon simplification", 0.7, 0, 1)

#Polygon z-koordinatai manualis megadassal (CSP)
gen.add("poly_z_manual", double_t, 0, "Set a constant polygon height", -1.5, -5, 5)

#Egyszerusitett polygon z-koordinatai atlagbol (CSP)
gen.add("poly_z_avg_allow", bool_t, 0, "Set polygon height to average value", True)

exit(gen.generate(PACKAGE, "urban_road_filter", "LidarFilters"))
